using facade.Factory.AbstractFactory;
using facade.Factory.AbstractFactory.Factory;
using Microsoft.AspNetCore.Mvc;
using util.AttributeExtension;
using util.EnumExtion;

namespace openapi.Controllers
{
    /// <summary>
    /// 抽象工厂
    /// </summary>
    [ApiController]
    [Route("[controller]")]
     //[ApiExplorerSettings(GroupName = "AbstractFactory")]
     //  [ApiGroupName("AbstractFactory")]
     [ApiGroupName(ApiGroupNameEnum.AbstractFactory)]
    public class AbstractFactoryController:ControllerBase
    {
        /// <summary>
        /// 肯德鸡咖啡
        /// </summary>
        /// <returns></returns>
        [HttpGet("KFCCoffee")]
        public string KFCCoffee()
        {
            AbstractFactory abstractFactory=new KFCFactory();
            ICoffee coffee= abstractFactory.GetCoffee();
            return coffee.Eat();
        }
        /// <summary>
        /// 肯德鸡土豆
        /// </summary>
        /// <returns></returns>
        [HttpGet("KFCTomato")]
        public string KFCTomato()
        {
            AbstractFactory abstractFactory=new KFCFactory();
            ITomato tomato= abstractFactory.GetTomato();
            return tomato.Eat();
        }
        /// <summary>
        /// 麦当劳咖啡
        /// </summary>
        /// <returns></returns>
        [HttpGet("MCDCoffee")]
         public string MCDCoffee()
        {
            AbstractFactory abstractFactory=new MCDFactory();
            ICoffee coffee= abstractFactory.GetCoffee();
            return coffee.Eat();
        }
        /// <summary>
        /// 麦当劳土豆
        /// </summary>
        /// <returns></returns>
        [HttpGet("MCDTomato")]
        public string MCDTomato()
        {
            AbstractFactory abstractFactory=new MCDFactory();
            ITomato tomato= abstractFactory.GetTomato();
            return tomato.Eat();
        }
    }
}